package com.imooc.mall.controller;

import com.imooc.mall.common.ResultInfo;
import com.imooc.mall.dto.CategoryDto;
import com.imooc.mall.service.ICategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

@RestController
@RequestMapping(("/category"))
public class CategoryController {


    @Autowired
    ICategoryService categoryService;

    @RequestMapping("/findAll")
    public ResultInfo<List<CategoryDto>> findAll(){
        return categoryService.findAll();
    }

   /* @RequestMapping("/getSubCategoryId/{id}")
    public ResultInfo getSubCategoryId(@PathVariable Integer id){
        Set<Integer> resultSet=new HashSet<>();
        return categoryService.findSubCategoryId(id,resultSet);
    }*/

}
